import request from '@/api/request'

const API = Object.freeze({
  CROWD_DATA_URL: 'api/v2/distribution/xmp/user', // 人群、moca
  DEVICE_DATA_URL: 'api/v2/distribution/xmp/device', // 设备信息
  ELDER_DATA_URL: 'api/v2/distribution/xmp/focus', // 五大维度
});

// 获取数据---人群、moca
export const getCrowdData = async (sid) => {
  const res = await request({
    method: 'GET',
    url: API.CROWD_DATA_URL,
    params: { sid }
  })
  console.log(res, 'crowd、moca')
  return res.data.data
}


// 设备信息
export const getDeviceData = async (sid) => {
  const res = await request({
    method: 'GET',
    url: API.DEVICE_DATA_URL,
    params: { sid }
  })
  console.log(res, '设备')

  return res.data.data
}

// 五大维度
export const getElderData = async (sid) => {
  const res = await request({
    method: 'GET',
    url: API.ELDER_DATA_URL,
    params: { sid }
  })
  console.log(res, '五大维度')

  return res.data.data
}
